﻿using Direct.IDAL.Manager.Money;
using DirectSell.Model.Money;
using DirectSell.Model.Query;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Webdiyer.WebControls.Mvc;

namespace DirectSell.DAL.User.Money
{
    /// <summary>
    /// 收支查询
    /// </summary>
    public class EarningRepository:AbsRepository, IEarningRepository
    {
        #region 查询收入支出
        /// <summary>
        /// 查询收入支出
        /// </summary>
        /// <returns></returns>
        public async Task<PagedList<Consumption>> QueryEarning(string usercode,int pageindex,int pagesize)
        {
            PageParam model = new PageParam()
            {
                PageIndex = pageindex,
                PageSize = pagesize,
                StrWhere = $" Operator='{usercode}'",
                TableName = "Consumption",
                OrderBy = "Id DESC"
            };
            return await base.PageQuery<Consumption>(model);
            //string str = string.Format(" SELECT * FROM Consumption WHERE Operator='{0}' ",usercode);
            //return base.Query<Consumption>(str) as IList<Consumption>;
        }
        #endregion
    }
}
